package org.carl.component.dingtalk.robot.config;

import org.carl.component.dingtalk.robot.annotation.EnableDingTalkRobot;
import org.carl.component.dingtalk.robot.bean.DingTalkRobot;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 钉钉配置
 *
 * @author Carl
 */
@ConditionalOnBean(annotation = EnableDingTalkRobot.class)
@Configuration
public class DingTalkConfig {

    @Bean
    @ConfigurationProperties("carl.dingtalk")
    public DingTalkRobot dingtalkRobot() {
        return new DingTalkRobot();
    }
}
